home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / lib / partman / check.d / 07efi < prev    next >
Encoding:
Text File  |  2007-04-12  |  1.1 KB  |  49 lines

  1. #!/bin/sh
  2.  
  3. # On Intel Macs, it isn't entirely clear that you have to have an EFI system
  4. # partition; see http://refit.sourceforge.net/myths/ for further details. In
  5. # the meantime, we only force an EFI system partition on ia64.
  6. if [ ! -e /var/lib/partman/efi ] || \
  7.    [ "$(udpkg --print-architecture)" != ia64 ]; then
  8.     exit 0
  9. fi
  10.  
  11. . /lib/partman/definitions.sh
  12.  
  13. have_efi=no
  14.  
  15. # Is there at least one efi-partition?
  16. for dev in $DEVICES/*; do
  17.     [ -d "$dev" ] || continue
  18.     cd $dev
  19.     partitions=
  20.     open_dialog PARTITIONS
  21.     while { read_line num id size type fs path name; [ "$id" ]; }; do
  22.     [ "$fs" != free ] || continue
  23.     partitions="$partitions $id,$num"
  24.     done
  25.     close_dialog
  26.     
  27.     for part in $partitions; do
  28.     id=${part%,*}
  29.     num=${part#*,}
  30.     [ -f $id/method ] || continue
  31.     method=$(cat $id/method)
  32.     if [ "$method" = efi -a -f $id/bootable ]; then
  33.         have_efi=yes
  34.     fi
  35.     done
  36.     
  37. done
  38.  
  39. if [ $have_efi = no ]; then
  40.     db_input critical partman-efi/no_efi || true
  41.     db_go || exit 1
  42.     db_get partman-efi/no_efi
  43.     if [ "$RET" = 'true' ]; then
  44.         exit 1
  45.     fi
  46. fi
  47.  
  48. exit 0
  49.